package com.mjlf.proxy.jdk;

import com.sun.deploy.net.proxy.ProxyUtils;

import java.lang.reflect.InvocationHandler;

/**
 * @ClassName Test
 * @auther mjlf
 * @Date 2019/9/18 15:52
 * @Description 测试类
 */
public class Test {
    public static void main(String[] args) throws Exception {
        Go go = new Go();
        ClassLoader classLoader = go.getClass().getClassLoader();
        Class[] interfaces = go.getClass().getInterfaces();
        InvocationHandler handle = new Proxy(go);

        GoService goService = (GoService) java.lang.reflect.Proxy.newProxyInstance(classLoader, interfaces, handle);

        goService.go();
    }
}
